import { RouteRecordRaw, RouterView } from "vue-router";

const permissionRoutes: RouteRecordRaw = {
  path: 'permission',
  name: 'permission',
  component: RouterView,
  meta: {
    title: '设置'
  },
  children: [
    {
      path: 'admin',
      name: 'PermissionAdmin',
      component: () => import('@/views/permission/admin/index.vue'),
      meta: {
        title: '管理员'
      },
    },
    {
      path: 'role',
      name: 'PermissionRole',
      component: () => import('@/views/permission/role/index.vue'),
      meta: {
        title: '角色'
      },
    },
    {
      path: 'rule',
      name: 'PermissionRule',
      component: () => import('@/views/permission/rule/index.vue'),
      meta: {
        title: '权限'
      },
    }
  ]
}

const routes: RouteRecordRaw = {
  path: 'setting',
  name: 'setting',
  component: RouterView,
  children: [
    permissionRoutes
  ]
}

export default routes
